django + celery + redis: max connections reached · Issue #178 · celery/kombu · GitHub

您所在的位置:网站首页 redis too many connections django + celery + redis: max connections reached · Issue #178 · celery/kombu · GitHub

django + celery + redis: max connections reached · Issue #178 · celery/kombu · GitHub

2024-07-09 10:53| 来源: 网络整理| 查看: 265

Hi! I use django + celery + redis

And i want to update from celery 2.4 up to 3. I've installed celery==3.0.11 django-celery==3.0.11 redis==2.7.2

But i've got strange stable bug — every time worker takes task, it creates a lot of new connection to redis. I set max connections value to 128 in redis. I tried to debug this. Celery uses kombu to communicate with redis. Kombu uses redis-py and connection pool.

But in source of kombu/transport/redis.py i cannot see where you set up max_connections for pool (so, options like BROKER_POOL_LIMIT changes nothing?)

565 def _connparams(self):$ 566 conninfo = self.connection.client$ ... 578 return {'host': conninfo.hostname or '127.0.0.1',$ 579 'port': conninfo.port or DEFAULT_PORT,$ 580 'db': database,$ 581 'password': conninfo.password}$ 586 def _get_pool(self):$ 587 return redis.ConnectionPool(**self._connparams())$

I run celery worker -c 1 And after run this i have +44 stable connections to redis! Only one Channel in use. Look like channel works ok, then falls in poll mode (_in_poll is True) and creates new connection. I can't find place in source code where you close or reuse old connection.

So can you explain me, is it bug or may be i do something wrong?



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3